//  导入request。js请求工具
import request from '@/uitls/request.js';

import { useTokenStore } from '@/stores/token.js'

const tokenStore = useTokenStore()
//提供文章列表列表查询接口
export const articleCategoryList = (params) => {
  return request.post('/categroy/list', params);
  // return request.post('/categroy/list', params,{ headers: { Authorization:  tokenStore.token }});
}

// 添加文章分类
export const articleCategoryAdd = (params) => {
  return request.post('/categroy/add', params)
}

// 修改文章分类
export const articleCategoryUpdate = (params) => {
  return request.post('/categroy/update', params)
}

// 删除文章分类
export const articleCategoryDelete = (params) => {
  return request.delete('/categroy/delete?id=' + params)
}


// 文章列表查询接口
export const articleList = (params) => {
  return request.post('/article/list', params);
}

// 删除文章
export const articleDelete = (params) => {
  return request.delete('/article/delete?id=' + params)
}

// 添加文章
export const articleAdd = (params) => {
  return request.post('/article/add', params);
}

// 修改文章
export const articleUpdate = (params) => {
  return request.post('/article/update', params);
}